<div class="page">
	<div class="pageContent">
	
	<form method="post" action="__APP__/Article/articleUpdate/table/{$table}/navTabId/__MODULE__" class="pageForm required-validate" onsubmit="return validateCallback(this, closeDialogAjaxDone)">
		<div class="pageFormContent" layoutH="58">
			<div class="unit">
				<label>类别所属：</label>
				<select name="category_id" class="required">
				<volist name="categorys" id="vo">	
					<option value="{$vo.id}" <if condition="$vo.id eq $record.category_id">selected="selected"</if>  >{$vo.name}</option>	
				</volist>
				</select>
			</div>
			
			<div class="unit">
				<label>文章标题：</label>
				<input type="hidden" name="id" value="{$record.id}" />
				<input type="text" class="required" size="105" minlength="6" maxlength="100" name="title" value="{$record.title}"/>
			</div>
			
			<div class="unit">
				<label>文章简介：</label>
				<textarea class="required textInput" cols="102" rows="3" maxlength="500" name="desc">{$record.desc}</textarea>
			</div>
			
			<div class="unit">
				<label>文章内容：</label>
				<div style="width:780px;float:left;margin-left:130px;"><script type="text/plain"  id="content" name="content">{$record.content}</script></div>
				<input type="hidden" name="img_path" id="img_path" value=""/>
			</div>
		</div>
		
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">添加</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div>
	</form>
	
	</div>
</div>

<script type="text/javascript">
var editor = new baidu.editor.ui.Editor({  
    toolbars:[['paragraph','customstyle','justifyleft', 'justifycenter', 'justifyright', 'justifyjustify','bold','italic','underline','fontsize','fontfamily','touppercase','tolowercase','forecolor', 'backcolor',
    	'fontborder','strikethrough', 'superscript', 'subscript','insertimage']],  
    maximumWords:3000, 
    initialFrameHeight:250,
});  
editor.render( 'content' );

editor.addListener('beforeInsertImage', function(t, arg){
	//$("#pics").attr("value", arg[0].src);
	var img_path = $("#img_path").val().trim();
	if (img_path == null || img_path == '')
		img_path = arg[0].src;
	else
		img_path += '|'+arg[0].src;
	$("#img_path").val(img_path);
});

</script>